import {
	http
} from '@/utils/request/index.js'

// 登录方法
export function login(username, password, captchaVerification) {
	const data = {
		username,
		password,
		captchaVerification
	}
	data.rememberMe = true
	return http.post('/system/auth/login', data)
}

// 获取用户详细信息
export function getInfo() {
	return http.get('/system/auth/get-permission-info')
}
// 获取用户详细信息
export function getSimple() {
	return http.get('/system/dict-data/simple-list')
}

export function getAreaTree() {
	return http.get('/system/area/tree')
}

// 退出方法
export function logout() {
	return request({
		url: '/system/auth/logout',
		'method': 'POST'
	})
}

// ordering Token (管理后台接口)
export function orderingLogin(token) {
	const data = {
		token
	}

	return http.post('/admin-api/ordering/third-party-login/login', data)
}